﻿using Serilog.Core;
using Serilog.Events;

namespace DongFangGuoKai.WMSPlatform.WebApi.Utility.SerilogExtend
{
    public class ThreadIdEnricher : ILogEventEnricher
    {
        public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
        {

            logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty(
                    "ThreadId", Environment.CurrentManagedThreadId));

        }
    }
}
